<?php

namespace app\common\model\server;

use app\common\contract\Category;
use app\common\contract\Curd;

class ArticleCategoryModel implements Curd, Category
{
    public function __construct()
    {
        $this->logic = model('logic.article_category');
    }

    //获取列表方法
    public function getListPage($data)
    {
        $data['parent_id'] = 0;

        return  $this->logic->getTree($data);
    }

    //获取列表方法
    public function getTreeAll()
    {
        $data['parent_id'] = 0;

        return  $this->logic->getTree($data);
    }

    //保存添加
    public function saveAdd($data)
    {
        return  $this->logic->saveAdd($data);
    }

    //获取某一行信息
    public function getRow($data)
    {
        return  $this->logic->getRow($data);
    }

    //根据条件获取单行
    public function getLine($where)
    {
        return  $this->logic->getLine($where);
    }

    //保存编辑
    public function saveEdit($data)
    {
        return  $this->logic->saveEdit($data);
    }

    //保存删除
    public function saveDel($data)
    {
        return  $this->logic->saveDel($data);
    }

    public function getTree($data = [])
    {
        $data['parent_id'] = 0;
        $data['status'] = 1;

        return  $this->logic->getTree($data);
    }
}
